package com.quick.develop.flowable.framework.manager.task;

import org.flowable.task.api.history.HistoricTaskInstance;
import org.flowable.task.service.TaskServiceConfiguration;
import org.flowable.task.service.impl.HistoricTaskInstanceQueryImpl;
import org.flowable.task.service.impl.persistence.entity.HistoricTaskInstanceEntityImpl;
import org.flowable.task.service.impl.persistence.entity.HistoricTaskInstanceEntityManagerImpl;
import org.flowable.task.service.impl.persistence.entity.data.HistoricTaskInstanceDataManager;

import java.util.Collections;
import java.util.List;

/**
 * @author junyuan.liu
 * @description: TODO
 * @date 2022/6/29 14:57
 */
public class CustomHistoricTaskInstanceEntityManager extends HistoricTaskInstanceEntityManagerImpl {
    
    public CustomHistoricTaskInstanceEntityManager(TaskServiceConfiguration taskServiceConfiguration, HistoricTaskInstanceDataManager historicTaskInstanceDataManager) {
        super(taskServiceConfiguration, historicTaskInstanceDataManager);
    }

    @Override
    public List<HistoricTaskInstance> findHistoricTaskInstancesByQueryCriteria(HistoricTaskInstanceQueryImpl historicTaskInstanceQuery) {
        HistoricTaskInstanceEntityImpl hi = new HistoricTaskInstanceEntityImpl();
        hi.setId("ididid");
        hi.setAssignee("test");
        hi.setTaskDefinitionKey("A101");
        
        
        return Collections.singletonList(hi);
    }

    @Override
    public List<HistoricTaskInstance> findHistoricTaskInstancesAndRelatedEntitiesByQueryCriteria(HistoricTaskInstanceQueryImpl historicTaskInstanceQuery) {
        HistoricTaskInstanceEntityImpl hi = new HistoricTaskInstanceEntityImpl();
        hi.setId("ididid");
        hi.setAssignee("test");
        hi.setTaskDefinitionKey("A101");


        return Collections.singletonList(hi);
    }
    
    
}
